<%--
  Created by IntelliJ IDEA.
  User: MeUChT
  Date: 2021/12/23
  Time: 17:41
  To change this template use File | Settings | File Templates.
--%>

<%@page pageEncoding="utf-8" import="java.util.*,bean.Student" %>
<%@taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<html>

<body>
<table border="1">
    <tr>
        <th>学号</th>
        <th>姓名</th>
        <th>性别</th>
    </tr>
    <c:forEach var="student" items="${result}">
        <tr>
            <td>${student.sno}</td>
            <td>${student.sname}</td>
            <td>${student.sex}</td>
        </tr>
    </c:forEach>
</table>
<hr/>显示结果（用脚本代码）<br/>
<% List<Student> studentList = (List<Student>)request.getAttribute("result"); %>
<table border="1">
    <tr><th>学号</th>
        <th>姓名</th>
        <th>性别</th>
    </tr>
    <% for (Student student:studentList){%>
    <tr>
        <td><%=student.getSno()%></td>
        <td><%=student.getSname()%></td>
        <td><%=student.getSex()%></td>
    </tr>
    <%}%>

</table>

</body>
</html>
